// 试题录入

import request from '@/utils/request'

// 获取所有文章列表
export function getArticles(params) {
  return request({
    url: '/questions',
    method: 'get',
    params
  })
}
// 文章详情
export function getArticle(id) {
  return request({
    url: '/questions/' + id,
    method: 'get'
  })
}
// 添加文章
export function addArticle(data) {
  return request({
    url: '/questions',
    method: 'post',
    data
  })
}
// 学科列表  subjects
export const getSubjects = () => {
  return request({
    url: '/subjects/simple',
    method: 'GET'
  })
}

// 获取目录
export const getSecondLevelDirectory = (params) => {
  return request({
    url: '/directorys/simple/',
    method: 'GET',
    params
  })
}
// 获取企业
export const getEnterprise = (params) =>
  request({
    url: '/companys',
    method: 'GET',
    params
  })
// 获取标签
export const getTagList = (params) =>
  request({
    url: '/tags/simple/',
    method: 'GET',
    params
  })
// 修改试题
export const editTitle = (data) =>
  request({
    url: '/questions/' + data.id,
    method: 'PUT',
    data
  })
